package com.xinghou.platform.entity.req;

import com.xinghou.platform.model.main.SubjectReply;
import org.springframework.util.StringUtils;

/**
 * Created by qingshengzheng on 16/6/23.
 */

public class SubjectReplyReq extends BaseReq {

    public String id;
    //话题ID
    public String subjectid;

    public String fromno;

    public String pagesize;

    public String praise_count;

    public String operator;

    public String direction;

    public String replytime;

    public String createtime;

    public String from;


    public String getOperator() {
        return operator;
    }

    public SubjectReplyReq setOperator(String operator) {
        this.operator = operator;
        return this;
    }

    public String getFromno() {
        return fromno;
    }

    public SubjectReplyReq setFromno(String fromno) {
        this.fromno = fromno;
        return this;
    }

    public String getId() {
        return id;
    }

    public SubjectReplyReq setId(String id) {
        this.id = id;
        return this;
    }

    public String getPagesize() {
        return pagesize;
    }

    public SubjectReplyReq setPagesize(String pagesize) {
        this.pagesize = pagesize;
        return this;
    }

    public String getPraise_count() {
        return praise_count;
    }

    public SubjectReplyReq setPraise_count(String praise_count) {
        this.praise_count = praise_count;
        return this;
    }

    public String getSubjectid() {
        return subjectid;
    }

    public SubjectReplyReq setSubjectid(String subjectid) {
        this.subjectid = subjectid;
        return this;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String userid;

    //话题回复
    public String description;



    public SubjectReply toSubjectReply()
    {
        SubjectReply reply=new SubjectReply();
        if(id!=null)
        reply.id=Long.parseLong(id);
        if(praise_count!=null)
            reply.praise_count=Long.parseLong(praise_count);
        reply.description=description;
        if(subjectid!=null)
        reply.subjectid=Long.parseLong(subjectid);
        if(userid!=null) {
            reply.uid = Long.parseLong(userid);
        }
        if(createtime!=null) {
            reply.createtime = Long.parseLong(createtime);
        }
        if(!StringUtils.isEmpty(replytime)) {
            reply.replyTime = Long.parseLong(replytime);
        }
        reply.operator=operator;
        return reply;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
